package com.jml.juc.lock;

public class SaleTicketDemo {
    public static void main(String[] args) {
        Ticket ticket = new Ticket();
        new Thread(()->{
            for (int i = 0; i < 30; i++) {
                ticket.saleTicket();
            }
        }, "窗⼝A").start();
        new Thread(()->{
            for (int i = 0; i < 30; i++) {
                ticket.saleTicket();
            }
        }, "窗⼝B").start();
        new Thread(()->{
            for (int i = 0; i < 30; i++) {
                ticket.saleTicket();
            }
        }, "窗⼝C").start();
    }
}
